<?php

/**
 * This is the model class for table "sys_ewallet".
 *
 * The followings are the available columns in table 'sys_ewallet':
 * @property string $ewallet_network_id
 * @property string $ewallet_cash_acc
 * @property string $ewallet_cash_paid
 * @property string $ewallet_products_acc
 * @property string $ewallet_products_paid
 * @property string $ewallet_voucher_acc
 * @property string $ewallet_voucher_paid
 */
class sys_ewallet extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return sys_ewallet the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sys_ewallet';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('ewallet_network_id, ewallet_cash_acc, ewallet_cash_paid, ewallet_products_acc, ewallet_products_paid, ewallet_voucher_acc, ewallet_voucher_paid', 'length', 'max'=>20),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('ewallet_network_id, ewallet_cash_acc, ewallet_cash_paid, ewallet_products_acc, ewallet_products_paid, ewallet_voucher_acc, ewallet_voucher_paid', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'ewallet_network_id' => 'Ewallet Network',
			'ewallet_cash_acc' => 'Ewallet Cash Acc',
			'ewallet_cash_paid' => 'Ewallet Cash Paid',
			'ewallet_products_acc' => 'Ewallet Products Acc',
			'ewallet_products_paid' => 'Ewallet Products Paid',
			'ewallet_voucher_acc' => 'Ewallet Voucher Acc',
			'ewallet_voucher_paid' => 'Ewallet Voucher Paid',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('ewallet_network_id',$this->ewallet_network_id,true);
		$criteria->compare('ewallet_cash_acc',$this->ewallet_cash_acc,true);
		$criteria->compare('ewallet_cash_paid',$this->ewallet_cash_paid,true);
		$criteria->compare('ewallet_products_acc',$this->ewallet_products_acc,true);
		$criteria->compare('ewallet_products_paid',$this->ewallet_products_paid,true);
		$criteria->compare('ewallet_voucher_acc',$this->ewallet_voucher_acc,true);
		$criteria->compare('ewallet_voucher_paid',$this->ewallet_voucher_paid,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}